package com.example.messagewall.mapper;

import com.example.messagewall.model.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageMapper {
    @Insert("INSERT INTO message_info (`from`,`to`,`message`) values (#{from},#{to},#{say})")
    Integer insertMessage(MessageInfo messageInfo);

    @Select("SELECT `from`,`to`,`message` from message_info")
    List<MessageInfo> selectAllMessage();

}
